package com.school.chapter02.graph_;

import java.util.ArrayList;
import java.util.Stack;

public class GraphDFSnr {
    //从顶点v开始，进行非递归的深度优先遍历
//    private Graph G;
    private boolean[] visited;
    private ArrayList<Integer> order = new ArrayList<>();//用来存储先序深度优先遍历结果的链表
    
    private void dfs(int v){
        Stack<Integer> stack = new Stack<>();
        stack.push(v);  //首先将v压入栈，同时，要记录visited[i]为true
        visited[v] = true;
        while (!stack.empty()){
            int cur = stack.pop();
            order.add(cur);
//            for (Object w :
//                    G.getAdj(cur)) {
//                if(!visited[W])

            }
        }
        
    }
    

